<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="CYW">
    <title></title>
    <style>
        body {
            margin: 0;
        }

        .nav {
            margin: 0 auto;
            width: 600px;
            height: 500px;
            border: 1px solid black;
        }

        ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        a {
            color: white;
            text-decoration: none;
        }

        .ulbox {
            width: 600px;
            height: 50px;
            background-color: #666;
            display: flex;
            justify-content: space-between;
        }

        .ulbox li {
            width: 100px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            position: relative;
            /* border:1px solid red;  */
        }

        .alert {
            width: 100px;
            border: 1px solid #999;
            position: absolute;
            top: 50px;
            left: 0;
            display: none;
        }

        .ulbox>li>a.color {
            color: orange;
        }

        .ulbox>li>a.line {
            text-decoration: underline;
        }
    </style>
</head>

<body>
    <nav class="nav">



        <ul class="ulbox">
            <li><a href="#">公司简介</a>
                <ul class="alert">
                    <li>概况介绍</li>
                    <li>发展历史</li>
                    <li>公司实力</li>
                </ul>
            </li>



            <li><a href="#">公司简介</a>
                <ul class="alert">
                    <li>概况介绍</li>
                    <li>发展历史</li>
                    <li>公司实力</li>
                </ul>
            </li>



            <li><a href="#">公司简介</a>
                <ul class="alert">
                    <li>概况介绍</li>
                    <li>发展历史</li>
                    <li>公司实力</li>
                </ul>
            </li>



            <li><a href="#">公司简介</a>
                <ul class="alert">
                    <li>概况介绍</li>
                    <li>发展历史</li>
                    <li>公司实力</li>
                </ul>
            </li>
        </ul>
    </nav>


    <script src="jquery.js"></script>
</body>

</html>
<script>
 
    $('.ulbox>li').mouseenter(function () {
        $(this).find('.alert').show();
    });
    $('.ulbox>li').mouseleave(function () {
        $(this).find('.alert').hide();
    });


      $('.ulbox>li>a').hover(function(){
        //   添加类名
         $(this).addClass('color')
         $(this).addClass('line')
      },function(){
        //   移除类名
          $(this).removeClass('color')
          $(this).removeClass('line')

      });
    
    $('.alert>li').hover(function(){
       $(this).css('text-decoration','underline')
    },function(){
        $(this).css('text-decoration','none')
    });
    



</script>